/**
* @description 事件基类 继承方法 extends BaseEvent 注意继承时要用 super();
*/
export default class BaseEvent {
    constructor() {
        this.eve = {};
    }
    on(ename, fun){
        const t = this;
        ename.split(" ").forEach(name=>{
            if(name){
                if(!t.eve[name])t.eve[name] = [];
                t.eve[name].push(fun);
            }
        })
        return t;
    }
    off(ename){
        const t = this;
        ename.split(" ").forEach(name=>{
            if(name){
                if(!t.eve[name])t.eve[name] = [];
                t.eve[name]=[];
            }
        })
    }
    trigger(eName, params) {
        const t = this;
        t.eve[eName].forEach(func => {
        　　func.call(this, params);
        })
    }
}